﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using MockPrjTeam4.Common;
using MockPrjTeam4.Entity;

namespace MockPrjTeam4.DAO
{
    public class PremiseDAO
    {
        public static DataTable GetPremise()
        {
            string query = string.Format("SELECT PremiseId, PremiseName, LocationName, " +
                            "Premise.AddressId, AddressLine1, PhoneNumber " +
                            "FROM Premise " +
                            "LEFT JOIN Addresses ON Premise.AddressId=Addresses.AddressId");
            try
            {
                return SqlHelper.ExecuteQuery(query);
            }
            catch (System.Exception ex)
            {
                return null;
            }
        }
    }
}